package com.alibaba.nacos.config.server.jpa.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * The type of nacos-all.
 *
 * @author 问道于盲
 * @date 2020-03-12
 *
 */
@Table(name = "NACOS_PERMISSIONS",uniqueConstraints = {
    @UniqueConstraint(name = "UK_ROLE_PERMISSION", columnNames = {"ROLE", "RESOURCE", "ACTION"})
})
@Entity
public class PermissionsEntity extends AbstractEntity{

    @Column(name = "ROLE", nullable = false)
    private String role;

    @Column(name = "RESOURCE", length = 512, nullable = false)
    private String resource;

    @Column(name = "ACTION", nullable = false)
    private String action;

    /**
     * get role
     *
     * @return role
     */
    public String getRole() {
        return role;
    }

    /**
     * set role
     *
     * @param role role
     */
    public void setRole(String role) {
        this.role = role;
    }

    /**
     * get resource
     *
     * @return resource
     */
    public String getResource() {
        return resource;
    }

    /**
     * set resource
     *
     * @param resource resource
     */
    public void setResource(String resource) {
        this.resource = resource;
    }

    /**
     * get action
     *
     * @return action
     */
    public String getAction() {
        return action;
    }

    /**
     * set action
     *
     * @param action action
     */
    public void setAction(String action) {
        this.action = action;
    }
}
